package com.starpl.mobile.android.monthunsae.november.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import com.starpl.mobile.android.monthunsae.november.R;
import com.starpl.mobile.android.platform.common.base.BaseActivity;


/**
 * 월별운세 정보 목록을 보여주는 Activity
 * 
 * @author 우연화
 * @since 2011.03.17
 */
public class UnsaeActivity extends BaseActivity implements OnClickListener
{
	private ImageButton mIbInfoChange;
	private LinearLayout mLlIntoroduction;
	private LinearLayout mLlLuckyDay;
	private LinearLayout mLlPrescription;
	private LinearLayout mLlHealth;
	private LinearLayout mLlBusiness;
	
	/* (non-Javadoc)
	 * @see com.starpl.platform.common.base.BaseActivity#onCreate(android.os.Bundle)
	 */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.unsae_activity);
		
		mIbInfoChange = (ImageButton)findViewById(R.id.unsae_activity_ib_info_change);
		
		mLlIntoroduction = (LinearLayout)findViewById(R.id.unsae_activity_ll_introduction);
		mLlLuckyDay = (LinearLayout)findViewById(R.id.unsae_activity_ll_lucky_day);
		mLlPrescription = (LinearLayout)findViewById(R.id.unsae_activity_ll_prescription);
		mLlHealth = (LinearLayout)findViewById(R.id.unsae_activity_ll_health);
		mLlBusiness = (LinearLayout)findViewById(R.id.unsae_activity_ll_business);
		
		mIbInfoChange.setOnClickListener(this);
		mLlIntoroduction.setOnClickListener(this);
		mLlLuckyDay.setOnClickListener(this);
		mLlPrescription.setOnClickListener(this);
		mLlHealth.setOnClickListener(this);
		mLlBusiness.setOnClickListener(this);
	}



	@Override
	public void onClick(View v)
	{
		Bundle extras;
		
		switch(v.getId())
		{
		// 정보수정 버튼 클릭
		case  R.id.unsae_activity_ib_info_change:
			extras = new Bundle();
			extras.putBoolean("isChange", true);
			
			getNewActivity()
				.setTargetActivity(JoinExtraActivity.class)
				.setBundle(extras)
				.show();
			return;
			
		// 총론
		case  R.id.unsae_activity_ll_introduction:
			extras = new Bundle();
			extras.putInt("unsaeType", 0);
			getNewActivity()
				.setTargetActivity(UnsaeDetailActivity.class)
				.setBundle(extras)
				.show();
			return;
		
		// 길일
		case  R.id.unsae_activity_ll_lucky_day:
			extras = new Bundle();
			extras.putInt("unsaeType", 1);
			getNewActivity()
				.setTargetActivity(UnsaeDetailActivity.class)
				.setBundle(extras)
				.show();
			return;

		// 처방전
		case  R.id.unsae_activity_ll_prescription:
			extras = new Bundle();
			extras.putInt("unsaeType", 2);
			getNewActivity()
				.setTargetActivity(UnsaeDetailActivity.class)
				.setBundle(extras)
				.show();
			return;
		
		// 건강운
		case  R.id.unsae_activity_ll_health:
			extras = new Bundle();
			extras.putInt("unsaeType", 3);
			getNewActivity()
				.setTargetActivity(UnsaeDetailActivity.class)
				.setBundle(extras)
				.show();
			return;
			
		// 영업/거래/매매운
		case  R.id.unsae_activity_ll_business:
			extras = new Bundle();
			extras.putInt("unsaeType", 4);
			getNewActivity()
				.setTargetActivity(UnsaeDetailActivity.class)
				.setBundle(extras)
				.show();
			return;
		}
		
	}

}
